import Vue from 'vue';
import VueRouter from 'vue-router'
const latestBlock = () => import('@/components/page/LatestBlocks.vue'); // 区块浏览器
const transaction = () => import('@/components/page/Transaction.vue'); // 交易
const blocks = () => import('@/components/page/Blocks.vue'); // 区块
const blocksDetailed = () => import('@/components/page/blocksDetailed.vue'); // 区块信息
const TransactionDetailed = () => import('@/components/page/TransactionDetailed.vue'); // 交易信息

const account = () => import('@/components/page/Account.vue'); // 账户
const accountTableF = () => import('@/view/Account/accountTableF.vue');
const accountTableS = () => import('@/view/Account/accountTableS.vue');	
const accountTableT = () => import('@/view/Account/accountTableT.vue');

const companyInfo = () => import('@/components/page/CompanyInfo.vue'); // 公司资料
const allCompany = () => import('@/components/page/AllCompany.vue'); // 所有企业
const tradingInfo = () => import('@/components/page/TradingInfo.vue'); // 所有企业


const companyOutline = () => import('@/components/page/CompanyOutline.vue'); // 公司概要
const recentEvents = () => import('@/view/CompanyOutline/news/recentEvent.vue'); // 公司概要 => 近期事件
const hotNews = () => import('@/view/CompanyOutline/news/hotNews.vue'); // 公司概要 => 热点新闻
const companyAnnounce = () => import('@/view/CompanyOutline/news/companyAnnounce.vue'); // 公司概要 => 公司公告

const financeOutline = () => import('@/components/page/FinanceOutline.vue'); // 财务概况
const enterpriseApplicate = () => import('@/components/page/EnterpriseApplication.vue'); // 企业申请
const news = () => import('@/components/page/News.vue'); // 新闻内页

const notFound = () => import('@/components/page/404.vue'); // 404

Vue.use(VueRouter);

const router = new VueRouter({
	linkActiveClass:'active',
	routes:[
        {
			path:'/',
			component: latestBlock ,
			name:"latestBlock",
			meta:{
				ExistFooter:true,
			}
		},
		{
			path:'/404',
			component: notFound ,
			name:"notFound",
			meta:{
				ExistFooter:true,
			}
		},
		{
			path:'/transaction',
			component: transaction ,
			name:"transaction",
			meta:{
				ExistFooter:true,
			}
		},
		{
			path:'/blocks',
			component: blocks ,
			name:"blocks",
			meta:{
				ExistFooter:true,
			}
        },
        {
			path:'/blocksDetailed/:id',
			component: blocksDetailed ,
			name:"blocksDetailed",
			meta:{
				ExistFooter:true,
			}
        },
        {
			path:'/TransactionDetailed/:id',
			component: TransactionDetailed ,
			name:"TransactionDetailed",
			meta:{
				ExistFooter:true,
			}
		},
		{
			path:'/companyInfo',
			component: companyInfo ,
			name:"companyInfo",
			meta:{
				ExistFooter:true,
			},
		},
		{
			path:'/allCompany',
			component: allCompany ,
			name:"allCompany",
			meta:{
				ExistFooter:true,
			},
		},
		{
			path:'/tradingInfo',
			component: tradingInfo ,
			name:"tradingInfo",
			meta:{
				ExistFooter:true,
			},
		},
		{
			path:'/enterpriseApplicate',
			component: enterpriseApplicate ,
			name:"enterpriseApplicate",
			meta:{
				ExistFooter:true,
			},
		},
		{
			path:'/financeOutline',
			component: financeOutline ,
			name:"financeOutline",
			meta:{
				ExistFooter:true,
			},
		},
		{
			path:'/news',
			component: news ,
			name:"news",
			meta:{
				ExistFooter:true,
			},
		},
		{
			path:'/companyOutline',
			component: companyOutline ,
			meta:{
				ExistFooter:true,
			},
			children:[
				{
					path:'',
					redirect:'recentEvents',
					
				},
				{
					path:'recentEvents',
					component: recentEvents,
					meta:{
						ExistFooter:true,
					},
				},
				{
					path:'hotNews',
					component: hotNews,
					meta:{
						ExistFooter:true,
					},
				},
				{
					path:'companyAnnounce',
					component: companyAnnounce,
					meta:{
						ExistFooter:true,
					},
				},
			]
		},
		{
			path:'/account/:mode/:id',
			component: account ,
			meta:{
				ExistFooter:false,
			},
			children:[
				{
					path:'',
					redirect:'accountTableF'
				},
				{
					path:'accountTableF',
					component: accountTableF
				},
				{
					path:'accountTableT',
					component: accountTableT
				},
				{
					path:'accountTableS',
					component: accountTableS
				},
			]
		},
        {
            path:'*',
            redirect: '/404'
        },
	]
})
router.beforeEach((to, from, next) => {
  next()
})
export default router;